/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package cardgame.game.monsters;

import cardgame.game.*;
import cardgame.game.events.*;

/**
 *
 * @author Carl
 */
public class SwordComboGirl extends MonsterCard{

    public SwordComboGirl(){
        description = new Description("Sword Combo Girl", "Can attack twice each turn.");
        manaTypes = new Mana[]{Mana.GREEN};
        summonCost = new Cost(new ManaAmount(Mana.GREEN, 2), 0, false);
        attackDamage = 2;
        setLifepoints(1);
    }
    private boolean hasResettedThisTurn;

    @Override
    public void postEvent(Game game, Event receivedEvent){
        super.postEvent(game, receivedEvent);
        if(receivedEvent instanceof AttackEvent){
            AttackEvent event = (AttackEvent) receivedEvent;
            if(event.getAttackingMonsterCard() == this){
                if(!hasResettedThisTurn){
                    game.triggerEvent(new UntapEvent(this));
                    hasResettedThisTurn = true;
                }
            }
        }
        else if(receivedEvent instanceof TurnEndEvent){
            hasResettedThisTurn = false;
        }
    }
}
